/*
    SDL - Simple DirectMedia Layer
    Partial implementation of SDL library (originally written by
    Sam Lantinga <slouken@libsdl.org>) for the particular purpose to support
    Prequengine (http://code.google.com/p/prequengine/) on BlackBerry(tm)
    tablets and smartphones.

    Copyright (C) 2013  xlamsp

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

    xlamsp@gmail.com
*/

#ifndef SDL_KEYBOARD_H_
#define SDL_KEYBOARD_H_

#include "SDL_stdinc.h"
#include "SDL_keysym.h"


/** Keysym structure
 *
 *  - The scancode is hardware dependent, and should not be used by general
 *    applications.  If no hardware scancode is available, it will be 0.
 *
 *  - The 'unicode' translated character is only available when character
 *    translation is enabled by the SDL_EnableUNICODE() API.  If non-zero,
 *    this is a UNICODE character corresponding to the keypress.  If the
 *    high 9 bits of the character are 0, then this maps to the equivalent
 *    ASCII character:
 *      @code
 *          char ch;
 *          if ( (keysym.unicode & 0xFF80) == 0 ) {
 *              ch = keysym.unicode & 0x7F;
 *          } else {
 *              An international character..
 *          }
 *      @endcode
 */
typedef struct SDL_keysym {
    Uint8 scancode;     /**< hardware specific scancode */
    SDLKey sym;         /**< SDL virtual keysym */
    SDLMod mod;         /**< current key modifiers */
    Uint16 unicode;     /**< translated character */
} SDL_keysym;


/**
 * Get a snapshot of the current state of the keyboard.
 * Returns an array of keystates, indexed by the SDLK_* syms.
 * Usage:
 *  @code
 *      Uint8 *keystate = SDL_GetKeyState(NULL);
 *      if ( keystate[SDLK_RETURN] ) //... \<RETURN> is pressed.
 *  @endcode
 */
extern Uint8 * SDL_GetKeyState(int *numkeys);

#endif /* SDL_KEYBOARD_H_ */

